package com.xcdh.lowcode;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * XcdhLowCodeApplication
 * Created by wjg on 2023/12/26.
 */
@SpringBootApplication
@MapperScan(basePackages = {"com.xcdh.lowcode.mapper"})
public class XcdhLowCodeApplication {

    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext app = SpringApplication.run(XcdhLowCodeApplication.class, args);
        // 获取本机IP
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = app.getEnvironment().getProperty("server.port");
        String appName = app.getEnvironment().getProperty("spring.application.name");
        System.out.printf("服务%s 启动成功 http://%s:%s%n",appName,ip,port);

    }
}
